#include <time.h>
#include <stdlib.h>
#include <stdio.h>
#include "GAframework.hpp"
#include "DistCaPClient.hpp"

int main(int argc, char **argv)
{
    srand(time(NULL));
    GAmodSettings params;
	DistCaPClient *client;

    //const char *tmp;
    //Popolazione pop(1);

    //gs.add_setting("pippo","pippopluto");

	if(argc!=2)
		params.read_from_file("prova.cnf","Validator");
	else
		params.read_from_file(argv[1],"Validator");

    try
    {
        client = new DistCaPClient(params);
    }
    catch(EHW_Exception &e)
    {
        printf("[ERROR] %s\n",e.msg.c_str());
        exit(1);
    }

    try
    {
        client->startClient();
    }
    catch(EHW_Exception &e)
    {
        printf("[ERROR] %s\n",e.msg.c_str());
        exit(1);
    }

	return 0;
}
